﻿//using System;
//using Microsoft.Practices.Unity;
//using Microsoft.VisualStudio.TestTools.UnitTesting;
//using TestByWire.AttributeHandlers;
//using TestByWire.AttributeHandlers.UseAdditionalTestTarget;
//using TestByWire.AttributeHandlers.UseStub;
//using TestByWire.AttributeHandlers.UseStubLateBound;
//using TestByWire.Infrastructure;

//namespace TestByWire
//{
//    [Serializable]
//    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
//    public sealed class TestByWireAttribute : TestClassExtensionAttribute
//    {
//        private readonly Uri _testByWireExtensionId = new Uri("urn:TestByWireTestClass");
//        //private TestByWireTestExtensionExecution _testByWireTestExtensionExecution;

//        public override TestExtensionExecution GetExecution()
//        {
//            var container = new UnityContainer();
//            container.RegisterInstance(new PipelineSettings());

//            var attributeStackManager = new AttributeStackManager(container);
//            attributeStackManager.RegisterAttributeHandler<UseStubLateBoundAttributeHandler>();
//            attributeStackManager.RegisterAttributeHandler<UseAdditionalTestTargetAttributeHandler>();
//            attributeStackManager.RegisterAttributeHandler<UseStubAttributeHandler>();

//            //TargetInvoker.Reset(container);
//            Recorder.Reset(container);
//            Then.Reset(container);

//            return new TestByWireTestExtensionExecution(attributeStackManager, container);
//        }

//        public override Uri ExtensionId
//        {
//            get { return _testByWireExtensionId; }
//        }
//    }
//}